<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body, ul{
      margin: 0;
      padding: 0;
    }
    body{
      background-image: url(../images/grid.png);
    }
    svg{
      background-color: rgba(255, 0, 0, 0.1);
    }

    #line1{
      /* 指定为虚线  100px */
      stroke-dasharray: 500px;
      /* 不可见 */
      stroke-dashoffset: 500px;
      animation: line1Move 2s linear forwards;
    }
    @keyframes line1Move{
      100%{
        stroke-dashoffset: 0px;  /* 可见 */
      }
    }

  </style>

</head>
<body>

  <svg width="300" height="300" xmlns="http://www.w3.org/2000/svg" >
    
    <!-- 
      stroke , 而不是 fill
     -->
    <line 
      id="line1"
      x1="100" y1="70"  x2="200" y2="70" 
      stroke="red" 
      stroke-width="10"
    >
    </line>


  </svg>

</body>
</html>